<template>
	<view>
		<scroll-view class="scroll-list bg-white" scroll-y="true">
			<u-cell-group v-for="(item, index) in list" :key="index" >
					<u-cell-item :arrow="true" @click="navTo('smck?id='+item.id+'&ccode='+item.ccode+'&cinvcode='+item.cinvcode+'&cinvname='+item.cinvname+'&inum='+item.inum+'&qty='+item.qty)">
						<view slot="label" class="u-font-lg">
							<view class="padding-bottom-sm text-bold"><text><text class="text-bold">{{index+1}}、</text>出库单号：{{item.ccode}}</text></view>
							<view class="padding-bottom-sm"><text >存货名称：{{item.cinvname}}</text></view>
						</view>
					</u-cell-item>
					<u-line color="blue" />
			</u-cell-group>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[],
			}
		},
		onShow() {
			this.loadBody();
		},
		onLoad(data) {
			this.ccode = data.ccode;
			this.loadBody();
		},
		methods: {
			/** 设置主表信息 */
			loadBody(){
				var query = {
					"code":this.ccode
				}
				var _this = this;
				this.$u.api.box.findRdrsInum(query).then(res=>{
					if(res.result == 'true'){
						_this.list = res.data;
					}else{
						uni.navigateBack();
					}
				});
			},
			navTo(url) {
				uni.navigateTo({
					url: url
				});
			}
		}
	}
</script>

<style>
@import '../btdm.css';
</style>
